Method for selecting an image for insertion into a document

ABSTRACT

One embodiment of the present invention provides a method for selecting an image for insertion into a document. A color harmony is received. A document color data of the document is accessed. An image color data of each of a plurality of images is accessed. A harmony measure is determined between the document color data and each of the image color data according to the color harmony.

CROSS-REFERENCE TO RELATED APPLICATIONS

This Utility Patent Application is related to U.S. patent application Ser. No. ______, Attorney Docket Number 200408243-1, entitled “IMAGE PROCESSING METHODS, IMAGE MANAGEMENT SYSTEMS, AND ARTICLES OF MANUFACTURE,” filed ??, 2006, which is incorporated herein by reference.

BACKGROUND

When inserting images into a document, a person can choose the image based on a number of aesthetic factors. One such factor is color harmony, which refers to a given relationship between colors. The color harmony provides a repeatable guideline or rule through which an image can be chosen based on the relationship between the color(s) of the image and the color(s) of the surrounding document.

Given a pool of images, a person will typically browse through each image and manually determine which images best match a given color harmony. When, for example, the image pool is large, the task of choosing an image can be tedious, time-consuming, and subject to human error. For these and other reasons, there is a need for the present invention.

SUMMARY

One embodiment of the present invention provides a method for selecting an image for insertion into a document. A color harmony is received. A document color data of the document is accessed. An image color data of each of a plurality of images is accessed. A harmony measure is determined between the document color data and each of the image color data according to the color harmony.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings are included to provide a further understanding of the present invention and are incorporated in and constitute a part of this specification. The drawings illustrate the embodiments of the present invention and together with the description serve to explain the principles of the invention. Other embodiments of the present invention and many of the intended advantages of the present invention will be readily appreciated as they become better understood by reference to the following detailed description. The elements of the drawings are not necessarily to scale relative to each other. Like reference numerals designate corresponding similar parts.

FIG. 1 is a block diagram of an image selection device illustrating one embodiment of the invention.

FIG. 2 is a flow diagram of a method of selecting an image illustrating one embodiment of the invention.

FIG. 3 is a flow diagram of a method of selecting an image illustrating another embodiment of the invention.

FIG. 4 is a diagram of a color wheel illustrating one embodiment of the invention.

DETAILED DESCRIPTION

In the following Detailed Description, reference is made to the accompanying drawings, which form a part hereof, and in which is shown by way of illustration specific embodiments in which the invention may be practiced. In this regard, directional terminology, such as “top,” “bottom,” “front,” “back,” “leading,” “trailing,” etc., is used with reference to the orientation of the Figure(s) being described. Because components of embodiments of the present invention can be positioned in a number of different orientations, the directional terminology is used for purposes of illustration and is in no way limiting. It is to be understood that other embodiments may be utilized and structural or logical changes may be made without departing from the scope of the present invention. The following detailed description, therefore, is not to be taken in a limiting sense, and the scope of the present invention is defined by the appended claims.

Embodiments of the invention include a system and method for selecting one or more images (hereinafter “the selected image”) to be inserted into a document. The selected image is selected from a plurality of images (hereinafter “the image group”). In one embodiment, the image group is stored in an image database. The selected image is selected from the image group based on a specified relationship between the document and the selected image. In one embodiment, the specified relationship is a color harmony.

FIG. 1 is a block diagram of an image selection device 100 illustrating one embodiment of the invention. Image selection device 100 includes a processor-based system 102, a storage device 104, and a user-interface device 106. Processor-based system 102 communicates bi-directionally with storage device 104 and user-interface device 106. In one embodiment, processor-based system 102 communicates with storage device 104 and/or user-interface device 106 via a network, such as the Internet.

Processor-based system 102 includes a processor 108 and a memory 110. In one embodiment, processor-based system 102 is a computer. In another embodiment, processor-based system 102 is a server. Processor 108 communicates bi-directionally with memory 110. Memory 110 includes any suitable storage media located internally or externally with respect to processor-based system 102. Memory 110 includes an image selection method 112. In one embodiment, image selection method 112 is a software program stored on memory 110 and executed by processor 108. In other embodiments, image selection method 112 is any suitable form of hardware, firmware, or software.

Storage device 104 includes an image group 114. Storage device 104 is any suitable storage media. In another embodiment, image group 114 is included in memory 110. Image group 114 includes a plurality of images. In one embodiment, image group 114 is a database.

User-interface device 106 provides one or more tools for a user to communicate with processor-based system 102. In one embodiment, user-interface device 106 includes an input device, such as a keyboard and/or a mouse, and an output device, such as a computer monitor. In another embodiment, user-interface 106 includes another processor-based system (not shown) for communicating with processor-based system 102 via a network, such as the Internet.

FIG. 2 is a flow diagram of a method 200 of selecting an image illustrating one embodiment of the invention. Method 200 involves determining the relationship between a document and an image to be inserted into the document with respect to a given color harmony. This relationship can be used to choose which image from a plurality of images best fits the document.

First color data of a document is accessed (at 202). Second color data for each image of a plurality of images is accessed (at 204). In one embodiment, the first color data and the second color data include RGB data. In other embodiments, the first color data and the second color data include data of any suitable color space, such as LAB, YUV, or YCC, capable of being utilized by image selection device 100. In one embodiment, the first color data excludes color data from the portion of the document where the selected image is to be inserted.

In one embodiment, the first color data and the second color data are obtained through the morphological processing described in “IMAGE PROCESSING METHODS, IMAGE MANAGEMENT SYSTEMS, AND ARTICLES OF MANUFACTURE,” which was incorporated herein by reference, supra. The morphological processing identifies plural regions of the images having a consistent or common characteristic. In one embodiment, the consistent or common characteristic identified by the morphological processing is a lexical color.

A harmony measure is determined (at 206) for each image in the plurality of images based on the first color data of the document and the second color data of each image. The harmony measure is a measure of the relationship between the first color data and the second color data with respect to a given color harmony. In one embodiment, a higher harmony measure indicates that the relationship between the first color data and the second color data more closely follows the given color harmony. In other embodiments, the harmony measure is any suitable indicator of the relationship between the first color data and the second color data with respect to the given color harmony.

The method of determining the harmony measure can differ depending on the given color harmony. The invention is capable of utilizing any suitable color harmony. Exemplary color harmonies include complementary, split complimentary, triadic, affine (i.e., analogous), clash and monochromatic.

In one embodiment, a user is provided a list of the images with the harmony measures indicative of the closest relationships between the first color data and the second color data with respect to the given color harmony. In another embodiment, the list of the images is ranked with respect to the harmony measures. In this way, the user does not have to search the plurality of images to find the images that relate to the given color harmony. The user can insert different images from the list into the document to determine which image best fits the document.

In another embodiment, the image or images with the harmony measures indicative of the closest relationships between the first color data and the second color data with respect to the given color harmony are inserted into the document or documents. In another embodiment, the document or documents with the inserted image or images are ranked with respect to the harmony measures. In this way, the user is provided with one or more suggestions as to the image that best fits the document. The user can view the one or more suggestions to determine which suggestion looks best.

FIG. 3 is a flow diagram of a method 300 of selecting an image illustrating another embodiment of the invention. Method 300 involves determining the relationship between a document and an image to be inserted into the document with respect to a given color harmony. This relationship can be used to choose which image from a plurality of images best fits the document.

A plurality of document regions are identified (at 302) in the document. In one embodiment, the plurality of document regions are identified in the document based on morphological processing of the document. A plurality of image regions are identified (at 304) in each image in a plurality of images. In one embodiment, the plurality of image regions are identified in each image based on morphological processing of each image.

In one embodiment, each document region and each image region is associated with color data of a suitable color space, such as RGB, LAB, YUV, or YCC. As previously noted, morphological processing is described in “IMAGE PROCESSING METHODS, IMAGE MANAGEMENT SYSTEMS, AND ARTICLES OF MANUFACTURE.” In one embodiment, each document region and each image region is associated with one of twenty-five (25) lexical colors.

A preliminary harmony measure is determined (at 306) between each document region of the plurality of document regions and each image region of the plurality image regions, based on one or more characteristics of the plurality of document regions and the plurality of image regions. Exemplary characteristics include the size of the document region, the size of the image region, the distance between the document region and the image region, and the difference in color between the document region and the image region.

In one embodiment, the preliminary harmony measure is determined by the following.

${harmony\_ measure}_{ij} = {{bin\_ factor}*\frac{\sqrt{{patchSize}_{i}*{patchSize}_{j}}}{\left( {1 + {centroidDist}_{ij}} \right)*\left( {1 + \left( {colorDist}_{ij} \right)^{4}} \right)}}$ ${centroidDist}_{ij} = \sqrt{\left( {{centroidX}_{i} - {centroidX}_{j}} \right)^{2} + \left( {{centroidY}_{i} - {centroidY}_{j}} \right)^{2}}$ ${colorDist}_{ij} = \sqrt{\begin{matrix} {\left( {{averageL}_{i} - {averageL}_{j}} \right)^{2} +} \\ {\left( {{averageA}_{i} - {averageA}_{j}} \right)^{2} + \left( {{averageB}_{i} - {averageB}_{j}} \right)^{2}} \end{matrix}}$

The harmony_measure_(ij) refers to the preliminary harmony measure for a given document region i and a given image region j . The bin_factor reduces the harmony_measure_(ij) if the document region i and the image region j are different colors. The bin_factor is 1 if the document region i and the image region j are the same color. The bin_factor is between 0.5 and 1 if the document region i and the image region j are different colors. In one embodiment, the bin_factor is 0.75 if the document region i and the image region j are different colors. In other embodiments, the bin_factor is any suitable value between 0 and 1, inclusive.

The patchSize_(i) refers to the size of the document region i, and the patchSize_(j) refers to the size of the image region j. In one embodiment, patchSize_(i) and patchSize_(j) refer to the area of the document region i and the area of the image region j, respectively.

The centroidDist_(ij) refers to the distance between the document region i and the image region j. It is assumed for purposes of determining the centroidDist_(ij) that the image in which image region j is located is scaled and inserted into the document region i. The centroid of the document region i and the centroid of the image region j are each identified by a physical coordinate (X, Y). The centroidX_(i) refers to the X coordinate of the centroid of the document region i, and the centroidX_(j) refers to the X coordinate of the centroid of image region j. The centroidY_(i) refers to the Y coordinate of the centroid of the document region i, and the centroidY_(j) refers to the Y coordinate of the centroid of the image region j. In other embodiments, the centroidDist_(ij) is any suitable determination of the distance between document region i and image region j.

The colorDist_(ij) refers to the difference between the lexical color of the document region i and the lexical color of the image region j. In one embodiment, colorDist_(ij) refers to the distance between the lexical color of the document region i and the lexical color of the image region j along a color wheel. In another embodiment, colorDist_(ij) refers to the angular difference between the lexical color of the document region i and the lexical color of the image region j along a color wheel. The invention can utilize any suitable color wheel. Exemplary color wheels include the RYB (red/yellow/blue) and the CMY (cyan/magenta/yellow).

The colorDist_(ij) utilizes the LAB color space. The LAB color space includes three color values: L*, a*, and b*. Combinations of the three color values, L*, a*, and b*, are used to represent a color. The averageL_(i) refers to the average of the L* values of the document region i, and the averageL_(j) refers to the average of the L* of the image region j. The averageA_(i) refers to the average of the a* values of the document region i, and the averageA_(j) refers to the average of the a* values of the image region j. The averageB_(i) refers to the average of the b* values of the document region i, and the averageB_(j) refers to the average of the b* values of the image region j. In other embodiments, the colorDist_(ij) utilizes RGB, YUV, YCC, or any suitable color space.

The harmony_measure_(ij) is inversely related to the colorDist_(ij). That is, as the colorDist_(ij) increases, the harmony_measure_(ij) decreases, and as the colorDist_(ij) decreases, the harmony_measure_(ij) increases. A higher harmony_measure_(ij) indicates the relationship between the lexical color of the document region i and the lexical color of the image region j more closely follows the affine color harmony, the monochromatic color harmony, or any suitable color harmony requiring colors close to each other on the color wheel. A lower harmony_measure_(ij) indicates the relationship between the lexical color of the document region i and the lexical color of the image region j more closely follows the complementary color harmony, the split complementary color harmony, or any suitable color harmony requiring colors far from each other on the color wheel.

In another embodiment, a preliminary harmony measure utilizes a direct relationship between the harmony_measure_(ij) and the colorDist_(ij). That is, as the colorDist_(ij) increases, the harmony_measure_(ij) increases, and as the colorDist_(ij) decreases, the harmony_measure_(ij) decreases. A lower harmony_measure_(ij) indicates the relationship between the lexical color of the document region i and the lexical color of the image region j more closely follows the affine color harmony, the monochromatic color harmony, or any suitable color harmony requiring colors close to each other on the color wheel. A higher harmony_measure_(ij) indicates the relationship between the lexical color of the document region i and the lexical color of the image region j more closely follows the complementary color harmony, the split complementary color harmony, or any suitable color harmony requiring colors far from each other on the color wheel.

In another embodiment, a preliminary harmony measure utilizes an inverse relationship between the harmony_measure_(ij) and the colorDist_(ij), and substitutes the lexical color of the document region i with a color corresponding to a given color harmony when determining the colorDist_(ij). Consider, for example, a split complementary color harmony. FIG. 4 is a diagram of a color wheel 400 illustrating one embodiment of the invention. Color wheel 400 includes twelve colors 402-422. In other embodiments, color wheel 400 includes any suitable number of colors. The split complementary color harmony requires the two colors adjacent to the complement of a given color along the color wheel. If, for example, the given color is color A 402, then the split complementary colors are color F 410 and color H 414.

The given color is the lexical color of the document region i. The two split complementary colors are determined from the given color. For purposes of determining the colorDist_(ij), the lexical color of document region i is substituted with each of the two split complementary colors. If, for example, the given color is color A 402, then the colorDist_(ij) is calculated two times: (1) between color F 410 and the lexical color of the image region j, and (2) between color H 414 and the lexical color of the image region j. In one embodiment, the smallest of the two values is chosen to represent colorDist_(ij) in determining the harmony_measure_(ij).

A higher harmony_measure_(ij) indicates the relationship between the lexical color of the document region i and the lexical color of the image region j more closely follows the given color harmony. A lower harmony_measure_(ij) indicates the relationship between the lexical color of the document region i and the lexical color of the image region j less closely follows the given color harmony.

In another embodiment, a preliminary harmony measure utilizes a weighting function instead of the colorDist_(ij). In one embodiment, the weighting function is directly related to the harmony_measure_(ij). Given the lexical color of the document region i, the colors corresponding to the given color harmony are weighted more heavily than the colors not corresponding to the given color harmony. Consider, for example, a split complementary color harmony.

Referring to FIG. 4, if the lexical color of the document region i is color A 402, then the lexical color of the image region j should be one of the two split complementary colors, color F 410 and color H 414. Thus, color F 410 and color H 414 are weighted more heavily than the other colors on the color wheel 400.

If the lexical color of the image region j is a color corresponding to the given color harmony, the weighting function is a higher value resulting in a higher harmony_measure_(ij). If the lexical color of the image region j is a color not corresponding to the given color harmony, the weighting function is a lower value resulting in a lower harmony_measure_(ij). In another embodiment, the weighting function is inversely related to the harmony_measure_(ij).

Referring again to FIG. 3, a final harmony measure is determined (at 308) by summing the plurality of preliminary harmony measures for all document regions i (i.e., i=1, 2, . . . [through the number of document regions]) and all image regions j (i.e., j=1, 2, . . . [through the number of image regions]) for each image in the plurality of images. In one embodiment, the final harmony measure is determined by the following.

${{final\_ harmony}{\_ measure}_{m}} = {\sum\limits_{i \in {document}}{\sum\limits_{j \in {image}}{harmony\_ measure}_{i,j}}}$

The final_harmony_measure_(m) refers to the final harmony measure for a given image m. In other embodiments, the final harmony measure is determined by any suitable manipulation of the preliminary harmony measures.

A higher final_harmony_measure_(m) indicates the relationship between the color(s) of the document and color(s) of the image m more closely follows the given color harmony. A lower final_harmony_measure_(m) indicates the relationship between the color(s) of the document and the color(s) of the image m less closely follows the given color harmony.

In one embodiment, a number of images with the highest harmony measures is provided to a user. In another embodiment, the number of images with the highest harmony measures are ranked and provided to the user. The user can insert different images from the provided images to determine which image best fits the document. In another embodiment, the image or images with the highest harmony measures are inserted into the document and provided to the user. In another embodiment, the image or images with the highest harmony measures are inserted into the document, ranked, and provided to the user.

Embodiments described and illustrated with reference to the Figures provide methods for selecting an image for insertion into a document. It is to be understood that not all components and/or steps described and illustrated with reference to the Figures are required for all embodiments. In one embodiment, one or more of the illustrative methods are preferably implemented as an application comprising program instructions that are tangibly embodied on one or more program storage devices (e.g., hard disk, magnetic floppy disk, RAM, ROM, CD ROM, etc.) and executable by any device or machine comprising suitable architecture, such as a general purpose digital computer having a processor, memory, and input/output interfaces.

Although specific embodiments have been illustrated and described herein, it will be appreciated by those of ordinary skill in the art that a variety of alternate and/or equivalent implementations may be substituted for the specific embodiments shown and described without departing from the scope of the present invention. This application is intended to cover any adaptations or variations of the specific embodiments discussed herein. Therefore, it is intended that this invention be limited only by the claims and the equivalents thereof. 

1. A method for selecting an image for insertion into a document, comprising: receiving a color harmony; accessing a document color data of the document; accessing an image color data of each of a plurality of images; and determining a harmony measure between the document color data and each of the image color data according to the color harmony.
 2. The method of claim 1, further comprising: outputting at least a portion of the plurality of images associated with the harmony measures indicative of closer relationships between the document color data and the image color data with respect to the color harmony.
 3. The method of claim 2, wherein outputting at least a portion of the plurality of images associated with the harmony measures indicative of closer relationships between the document color data and the image color data with respect to the given color harmony comprises: outputting at least a portion of the plurality of images associated with the higher harmony measures.
 4. The method of claim 1, wherein receiving a color harmony comprises: receiving one of a monochromatic color harmony, an analogous color harmony, a complementary color harmony, a split-complementary color harmony, a triadic color harmony, and a clash color harmony.
 5. The method of claim 1, wherein accessing a document color data of the document, comprises: extracting the document color data based on morphologically processing the document.
 6. The method of claim 1, wherein accessing an image color data of each of a plurality of images, comprises: extracting the image color data based on morphologically processing the each of the plurality of images.
 7. A method for selecting an image for insertion into a document, comprising: receiving a color harmony; identifying a plurality of document regions; identifying a plurality of image regions; and determining a preliminary harmony measure between each of the plurality of document regions and each of the plurality of image regions according to the color harmony.
 8. The method of claim 7, wherein identifying a plurality of document regions and identifying a plurality of image regions, comprises: identifying the plurality of document regions based on morphologically processing the document; and identifying the plurality of image regions based on morphologically processing the image.
 9. The method of claim 7, further comprising: determining a final harmony measure by summing the preliminary harmony measures.
 10. The method of claim 9, further comprising: repeating the steps of identifying a plurality of image regions, determining a preliminary harmony measure between each of the plurality of document regions and each of the plurality of image regions according to the color harmony, and determining a final harmony measure by summing the preliminary harmony measures for each of a plurality of images.
 11. The method of claim 10, further comprising outputting at least a portion of the plurality of images associated with the final harmony measures indicative of closer relationships between the first color data and the second color data with respect to the color harmony.
 12. The method of claim 11, wherein outputting at least a portion of the plurality of images associated with the final harmony measures indicative of closer relationships between the first color data and the second color data with respect to the color harmony comprises: outputting at least a portion of the plurality of images associated with the higher final harmony measures.
 13. The method of claim 7, wherein receiving a color harmony comprises: receiving one of a monochromatic color harmony, an analogous color harmony, a complementary color harmony, a split-complementary color harmony, a triadic color harmony, and a clash color harmony.
 14. The method of claim 7, wherein determining a preliminary harmony measure between each of the plurality of document regions and each of the plurality of image regions according to the color harmony comprises: determining the preliminary harmony measure based on the difference in color between the each of the plurality of document regions and the each of the plurality of image regions with respect to the color harmony.
 15. The method of claim 7, wherein determining a preliminary harmony measure between each of the plurality of document regions and each of the plurality of image regions according to the color harmony comprises: determining the preliminary harmony measure based on the difference in color between the each of the plurality of document regions and the each of the plurality of image regions with respect to the color harmony, the size of the each of the plurality of document regions, the size of the each of the plurality of image regions, and the distance between the each of the plurality of document regions and the each of the plurality of image regions.
 16. A machine-readable medium having instructions stored thereon for execution by a processor to perform a method for selecting an image for insertion into a document, the method comprising: receiving a color harmony from a user; accessing a document color data of the document; accessing an image color data of each of a plurality of images; determining a harmony measure between the document color data and each of the image color data according to the color harmony; and displaying at least a portion of the plurality of images corresponding to the harmony measures indicative of closer relationships between the document color data and the image color data with respect to the color harmony.
 17. The machine-readable medium of claim 16, wherein displaying at least a portion of the plurality of images corresponding to the harmony measures indicative of closer relationships between the document color data and the image color data with respect to the color harmony comprises: displaying a ranked list of at least a portion of the plurality of images corresponding to the harmony measures indicative of closer relationships between the document color data and the image color data with respect to the color harmony.
 18. The machine-readable medium of claim 16, wherein displaying at least a portion of the plurality of images corresponding to the harmony measures indicative of closer relationships between the document color data and the image color data with respect to the color harmony comprises: displaying the document within which one of the plurality of images is inserted, the one of the plurality of images corresponding to the harmony measure indicative of a closer relationship between the document color data and the image color data with respect to the color harmony.
 19. The machine-readable medium of claim 16, wherein accessing a document color data of the document and accessing an image color data of each of the plurality of images, comprises: identifying a plurality of document regions based on morphologically processing the document; and identifying a plurality of image regions for the each of the plurality of images based on morphologically processing the each of the plurality of images.
 20. The machine-readable medium of claim 16, wherein receiving a color harmony comprises: receiving one of a monochromatic color harmony, an analogous color harmony, a complementary color harmony, a split-complementary color harmony, a triadic color harmony, and a clash color harmony. 